<?php

use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;
use Dcat\Admin\Admin;

Admin::routes();

Route::group([
    'prefix'     => config('admin.route.prefix'),
    'namespace'  => config('admin.route.namespace'),
    'middleware' => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'HomeController@index');

    $router->resource('student', StudentController::class);
    $router->resource('project', ProjectController::class);
    $router->resource('plan', PlanController::class);
    $router->resource('sales', SaleController::class);

    Route::group(['prefix' => 'api'], function ($router) {
        $router->get('plan', 'FormSelectApiController@plan');
        $router->get('project', 'FormSelectApiController@project');
    });

    //公共
    Route::group(['namespace' => 'Common', 'prefix' => 'common'], function (Router $router) {
        $router->get('channelInvite', 'CommonLatitude@channelInvite');
    });
});

Route::group(['prefix' => 'api/board', 'namespace'  => 'App\\Admin\\Controllers'], function ($router) {
    $router->get('studentList', 'BoardController@studentList');
    $router->get('signStudent', 'BoardController@signStudent');
    $router->get('totalBoard', 'BoardController@totalBoard');
});

Route::group(['prefix' => 'api/invite', 'namespace'  => 'App\\Admin\\Controllers'], function ($router) {
    $router->post('regist', 'InviteController@regist');
    $router->post('scan', 'InviteController@scan');
    $router->get('signStudent', 'BoardController@signStudent');
    $router->get('totalBoard', 'BoardController@totalBoard');
});